import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';


// https://vitejs.dev/config/
export default defineConfig({
  base:"./",
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    }),
],
server: {
  //用来配置跨域
  // host: '127.0.0.1',
  // 代理
  proxy: {
    '/api': {
      target: 'http://182.92.162.156:8083',//目标服务器地址
      changeOrigin: true,
      rewrite: (path) => path.replace(/^\/api/, '')
    }
  }
}
})
